<?php
/**
*Mappers act as a proxy to the persistent layer. Each Mapper class makes a decision on how to *handle a particular Domain Object ( ie don't save, save to DB or Session')
*
*@package Business
*@author Garry Willits
*@copyright 2005
*@version 1.1
*/
abstract class Mapper{

/**
* Get a copy of the singleton
* @param Mapper
*/
protected static $instance;
/**
 * 
 * The type of mapper to instantiate
 * @var unknown_type
 */
protected static $type;
/**
*Instantiate the QueryManager
*@see QueryManager
*/
protected static function doGetInstance( $type  ){
    if( !self::$instance ){
    self::$instance = new $type( );
  }
return self::$instance;
}

abstract public static function GetInstance();
/**
*Find an object or set of objects
*@param int or array of ints
*@param array;
*@param array;
*/
public function find( $terms=null, $pointer=null ){
return $this->doFind(  $terms, $pointer );
}


abstract public function doFind( $terms );

abstract public function insert( $object );

abstract public function update( DomainObject $object );

abstract public function load( $object );

abstract public function delete( $object );

}
?>
